package com.chatroom.client.model;

import java.time.LocalDateTime;

/**
 * 聊天消息的数据模型。
 * 这是一个不可变对象 (Immutable Object)，所有字段都是 final 的。
 */
public class ChatMessage {
    private final String sender;
    private final String content;
    private final boolean isMine;
    private final LocalDateTime timestamp;
    private final MessageType type;

    public ChatMessage(String sender, String content, boolean isMine, LocalDateTime timestamp, MessageType type) {
        this.sender = sender;
        this.content = content;
        this.isMine = isMine;
        this.timestamp = timestamp;
        this.type = type;
    }

    // --- Getters ---

    public String getSender() {
        return sender;
    }

    public String getContent() {
        return content;
    }

    public boolean isMine() {
        return isMine;
    }

    public LocalDateTime getTimestamp() {
        return timestamp;
    }

    public MessageType getType() {
        return type;
    }
}
